package com.service.database.constants;

/**
 * SQL常量类
 * @author xianggj
 * @Date 2021/6/4 15:19
 **/
public class SqlConstants {

    /**
     * 数据转义符1
     * MYSQL
     */
    public static final String SPECIFIC_PARTITION_MYSQL = "`";

    /**
     * 数据转义符2
     * ORACLE,POSTGRES
     */
    public static final String SPECIFIC_PARTITION_ORACLE = "\"";
    /**
     * where
     */
    public static final String WHERE = " where ";
    /**
     * limit
     */
    public static final String LIMIT = " limit ";
    /**
     * offset
     */
    public static final String OFFSET = " offset ";
    /**
     * 逗号
     */
    public static final String COMMA = ",";
    /**
     * 查询开头
     */
    public static final String SELECT_HEADER = "select * from ";
    /**
     * 查询包含
     */
    public static final String SELECT_CONTAIN = "select * from (%s) table_alias";
    /**
     * 查询包含
     * ORCLE
     */
    public static final String SELECT_CONTAIN_ROWNUM = "SELECT ROWNUM AS rowno, t.* FROM (%s) t";
    /**
     * 查询条件
     * ORCLE
     */
    public static final String ROWNO = "table_alias.rowno";
    /**
     * 左括号
     */
    public static final String LEFT_BRACKET = "(";
    /**
     * 右括号
     */
    public static final String RIGHT_BRACKET = ")";
    /**
     * 计数
     * ORACLE
     */
    public static final String ROWNUM = " rownum ";

    /**
     * and
     */
    public static final String AND = " and ";

    /**
     * 小于等于
     */
    public static final String LESS_EQUELS = " <= ";

    /**
     * 大于等于
     */
    public static final String MORE_EQUELS = " >= ";

    /**
     * 字符串默认长度
     */
    public static final int DEFAULT_VARCHAR_LENGTH = 255;

}
